package com.example.alarm.api

import com.example.alarm.mvvm.bean.AlarmDetailBean
import com.example.alarm.mvvm.bean.FilesAttBean
import com.gsafety.libraryktx.bean.WarnData
import com.gsafety.libraryktx.base.RespBaseBean
import okhttp3.MultipartBody
import okhttp3.ResponseBody
import retrofit2.Call
import retrofit2.http.*
import java.util.*

/**
 * @author : lj
 * @date : 2020/9/18 11:20
 */
interface ApiService {
    @GET("rsubEwldMnWarnevents/currWarningListByPage")
    fun warnList(@QueryMap params: TreeMap<String, Any>): Call<RespBaseBean<WarnData>>

    @POST("bacoMnMyattation/insertMyAttation")
    fun setAttention(@Body params: TreeMap<String, Any>): Call<RespBaseBean<Boolean>>

    @POST("bacoMnMyattation/cancelMyAttation")
    fun cancelAttention(@Body params: TreeMap<String, Any>): Call<RespBaseBean<Boolean>>

    @POST("rsubEwldMnAdtevtprocess/addDisposalProc")
    fun addDisposalProc(@Body params: TreeMap<String, Any>): Call<RespBaseBean<String>>

    @GET("rsubEwldMnWarnevents/currWarningDetail")
    fun currWarningDetail(@QueryMap params: TreeMap<String, Any>): Call<RespBaseBean<AlarmDetailBean>>

    @Multipart
    @POST("bacoMnSysfiles/upload")
    fun upload(@Part files: List<MultipartBody.Part>): Call<RespBaseBean<List<FilesAttBean>>>

    // 下载附件接口
    @Streaming
    @GET
    fun downAttachFile(@Url url:String): Call<ResponseBody>
}